﻿@{
    Layout = null;
}
@using ElingOA6_Admin_DSJCJ.Common;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Top</title>

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <style type="text/css">
        *
        {
            margin: 0 auto;
            padding: 0;
        }
        .dlny
        {
            font-size: 14px;
            color: #FFFFFF;
        }
        .dlny a
        {
            font-size: 14px;
            color: #FFFFFF;
            text-decoration: none;
        }
        .dlny a:hover
        {
            font-size: 14px;
            color: #002036;
            text-decoration: none;
        }
        .dlnyhei
        {
            color: #000000;
            font-size: 12px;
        }
    </style>
    @{
        string aMAttendanceTime = ViewData["AMAttendanceTime"].ToString() == "" ? "未签到" : ViewData["AMAttendanceTime"].ToString();
        string pMAttendanceTime = ViewData["PMAttendanceTime"].ToString() == "" ? "未签退" : ViewData["PMAttendanceTime"].ToString();
        string attendanceIpAddress = ViewData["AttendanceIpAddress"] == null ? "" : ViewData["AttendanceIpAddress"].ToString();
     }
     <script>
         var jsAttendanceIpAddress = '@attendanceIpAddress';
     </script>
    <script>
        function logOut() {
            if (confirm("确定注销吗?")) {
                window.location.href = rootPath + "/Index/Logout";

            }
            else {
                return false;
            }
        }
        function LogExit() {
            if (confirm("确定退出吗?")) {
                window.location.href = rootPath + "/Index/LogExit";

            }
            else {
                return false;
            }
        }
        /*考勤签到*/
        function attendanceAM(obj) {
            if (jsAttendanceIpAddress == "") {
                if (confirm("签到签退一机一人，您确认以后采用该电脑地址签到签退吗（不能变更）?")) {
                    attendanceAM1(obj);
                } else {
                    alert("您未签到签退成功，请回自己的电脑进行签到签退!");
                }
            }
            else {
                attendanceAM1(obj);
            }
        }
        /*考勤*/
        function attendanceAM1(obj) {         
            if (obj == "未签到") {
                if (confirm("您是否确认签到？")) {
                    $.ajax({
                        type: "POST",
                        url: "/Index/Attendance",
                        data: {},
                        success: function (result) {
                            if (result != "") {
                                alert(result);
                                if (result == "请先登录") {
                                    window.location.replace("/ElingOA6_Admin_DSJCJ/Login?type=WSKQ");
                                } else {
                                    parent.location.reload(); 
                                }
                            }
                        }
                    });
                }
            } else {
                if (confirm("您已经在" + obj + "签到，是否确定继续签到？")) {
                    $.ajax({
                        type: "POST",
                        url: "/Index/Attendance",
                        data: {},
                        success: function (result) {
                            if (result != "") {
                                alert(result);
                                if (result == "请先登录") {
                                    window.location.replace("/ElingOA6_Admin_DSJCJ/Login?type=WSKQ");
                                } else {
                                    parent.location.reload(); 
                                }
                            }
                        }
                    });
                }
            }
        }
        function attendance(obj) {
            if (obj == "未签退") {
                //            if (confirm("您是否确认签退？")) {
                $.ajax({
                    type: "POST",
                    url: "/Index/Attendance",
                    data: {},
                    success: function (result) {
                        if (result != "") {
                            alert(result);
                            if (result == "请先登录") {
                                window.location.replace("/ElingOA6_Admin_DSJCJ/Login?type=WSKQ");
                            } else {
                                window.location.reload();
                            }
                        }
                    }
                });
                //            }

            } else {
                if (confirm("您已经在" + obj + "签退，是否确定继续签退？")) {
                    $.ajax({
                        type: "POST",
                        url: "/Index/Attendance",
                        data: {},
                        success: function (result) {
                            if (result != "") {
                                alert(result);
                                if (result == "请先登录") {
                                    window.location.replace("/ElingOA6_Admin_DSJCJ/Login?type=WSKQ");
                                } else {
                                    window.location.reload();
                                }
                            }
                        }
                    });
                }
            }
        }
        /*考勤签退*/
        function attendancePM(obj) {
            if (jsAttendanceIpAddress == "") {
                if (confirm("签到签退一机一人，您确认以后采用该电脑地址签到签退吗（不能变更）?")) {
                    attendancePM1(obj);
                } else {
                    alert("您未签到签退成功，请回自己的电脑进行签到签退!");
                }
            }
            else {
                attendancePM1(obj);
            }
        }
        //下午的按钮
        function attendancePM1(obj) {
            $.ajax({
                type: "POST",
                url: "/Index/IsCheck",
                data: {},
                success: function (result) {
                    if (result != "Y") {
                        if (confirm(result)) {
                            attendance(obj);
                        }
                    } else {
                        attendance(obj);
                    }
                }
            });
        }
    
    </script>

</head>
<body>
    <table width="100%" cellpadding="0" cellspacing="0" style="background: url(@Url.Content("~/Content/images/dlnybg.jpg", true)) repeat-x left;">
        <tr>
            <td width="10%">
                <img src="@Url.Content("~/Content/images/dlnylogo1.jpg", true)" width="475" height="74" /></td>
            <td width="90%" align="right" valign="bottom">
                <table width="450" align="right" cellpadding="0" cellspacing="0" class="dlny">
                    <tr>
                       @* <td width="120" align="left">
                        <a href="javascript:;" onclick="attendance()" style="color:Red;font-weight:bold;">网上考勤</a></td>*@
                        <td width="17" align="left" >
                            <img src="@Url.Content("~/Content/images/desktop.jpg", true)" width="17" height="17" /></td>
                        <td width="75" align="left" class="wi" >
                            <a href="/" target="_blank">首页</a></td>
                        <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon.jpg", true)" width="17" height="17" /></td>
                        <td width="75" align="left" class="wi">
                            <a target="_top" href="@Url.Content("~/")">桌面</a></td>
                            <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/emplInfo.jpg", true)" width="17" height="17" /></td>
                        <td width="120" align="left" class="wi">
                            <a href="/ElingOA6_Admin_DSJCJ/Admin/Empl/EmpSelfInfoEdit" target="contentframe">个人信息</a></td>
                            @*<td width="120" align="left">
                            @if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse((DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " " + "12:00").ToString()))
                            {
                                <a href="javascript:;" onclick="attendanceAM('@aMAttendanceTime')" style="color:Red;">签到/签退</a>
                            }
                            else
                            {
                                <a href="javascript:;" onclick="attendancePM('@pMAttendanceTime')" style="color:Red;">签到/签退</a>
                            }    
                                
                            </td>*@
                        @*<td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon2.jpg", true)" width="17" height="17" /></td>
                        <td width="120" align="left">
                            <a href="/ElingOA6_WebMail" target="_blank">资料传递</a></td>*@
                        <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon3.jpg", true)" width="17" height="17" /></td>
                        <td width="120" align="left">
                            <a href="/ElingOA6_Admin_DSJCJ/Admin/Password" target="contentframe">修改密码</a></td>
                        <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon4.jpg", true)" width="17" height="17" /></td>
                        <td width="79" align="left">
                            <a href="@Url.Content("~/Content/help_doc.mht", true)" target="_blank">帮助</a></td>
                        <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon5.jpg", true)" width="17" height="17" /></td>
                        <td width="60" align="left">
                            <a href="#" onclick="logOut()">注销</a></td>
                        <td width="17" align="left">
                            <img src="@Url.Content("~/Content/images/dlicon6.jpg", true)" width="17" height="17" /></td>
                        <td width="70" align="left">
                            <a href="#" onclick="LogExit()">退出</a></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
